home *** CD-ROM | disk | FTP | other *** search
- /* clr() - Used to clear the screen. */
-
- #include <term.h>
- #include <stdio.h>
- #include <stdlib.h>
-
- #define ERROR -1
-
- void clr()
- {
- char *clear;
- char clbuf[1024];
- char *clbp = clbuf;
-
- if (tgetent(clbuf, getenv("TERM")) == ERROR) {
- perror("tgetent");
- exit(ERROR);
- }
-
- /* This will give a warning without the typecast (broken prototype?) */
- if ((clear = tgetstr("cl", &clbp)) == NULL) {
- perror("tgetstr");
- exit(ERROR);
- }
-
- if (clear)
- tputs(clear, tgetnum("li"), putchar);
-
- }
-